<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="carame">
        <h1>鼠标滚动</h1>
    </div>
</body>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    body {
        margin-bottom: 20000px;
    }

    h1 {
        position: absolute;
        left: 100px;
        top: 100px;
        font-size: 40px;
        color: white;
    }

    .carame {
        position: fixed;
        width: 100vw;
        height: 100vh;
        background-image:
            url('https://wwwstatic.vivo.com.cn/vivoportal/files/resource/product/1603437675413/images/camera_1.jpg');
        background-color: black;
    }
</style>
<script>
    let i = 1
    window.onscroll = () => {
        if (document.documentElement.scrollTop % 2 == 0) {
            i++
        }
        if (i > 49) {
            i = 0
        }
        var img = new Image();
        img.src =
            `https://wwwstatic.vivo.com.cn/vivoportal/files/resource/product/1603437675413/images/camera_${i}.jpg`;
        img.onload = () => {
            document.querySelector('.carame').style.backgroundImage =
                `url(https://wwwstatic.vivo.com.cn/vivoportal/files/resource/product/1603437675413/images/camera_${i}.jpg)`
        }
    }
</script>

</html>